﻿using HCQ2_Model.APPModel.ParamModel;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HCQ2_Model.VLine.InputDto._0416
{
    /// <summary>
    ///  添加、编辑商品折扣
    /// </summary>
    public class GoodRate:BaseAPI
    {
        /// <summary>
        /// 店铺id
        /// </summary>
        [RegularExpression("^([1-9][0-9]*)$", ErrorMessage = "店铺id必传项！")]
        public int store_id { get; set; }
        /// <summary>
        ///  商品id
        /// </summary>
        [RegularExpression("^([1-9][0-9]*)$", ErrorMessage = "商品id必传项！")]
        public int file_id { get; set; }
        /// <summary>
        ///  折扣明细
        /// </summary>
        public List<RatePrice> rateList { get; set; }
    }
    /// <summary>
    ///  折扣明细
    /// </summary>
    public class RatePrice
    {
        /// <summary>
        ///  用户等级
        /// </summary>
        [RegularExpression("^([1-9][0-9]*)$", ErrorMessage = "用户等级必须项！")]
        public int user_level { get; set; }
        /// <summary>
        ///  折扣率【1-10】规则：大于1小于等于10的整数或小数，小数后最多只能有一位！
        /// </summary>
        //[RegularExpression("^100$|^[1-9]$|^([1-9][0-9])$", ErrorMessage = "折扣率必须大于0小于等于100的整数！")]
        [RegularExpression("^10$|^[1-9]([.][0-9]{0,1})?$", ErrorMessage = "折扣率必须大于1小于等于10的整数或小数，小数后最多只能有一位！")]
        public int rate { get; set; }
        /// <summary>
        ///  备注
        /// </summary>
        public string note { get; set; }
    }
    /// <summary>
    ///  获取商品折扣
    /// </summary>
    public class GoodRatePram
    {
        /// <summary>
        ///  商品id
        /// </summary>
        [RegularExpression("^([1-9][0-9]*)$", ErrorMessage = "商品id必须项！")]
        public int file_id { get; set; }
    }
}